package com.kepler.social.web.configuration;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

@Configuration
public class SecuritySubUnitConfig {

    /**
     * 和SecurityConfig的LoginValidateAuthenticationProvider时候，两个放在一起存在循环依赖的问题
     * 用context.getClass(Clazz)也可以获得
     *
     * @return
     */
    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }
}